function [chunksize,tcSplit] = dreumDataSplit2(Ncpu,Nu,tc)
% Splits data into "chunks," where each chunk is sent to a different core 
% during parallelization 

tcSplit = cell(1,Ncpu);

chunksize = zeros(1,Ncpu);
ct = 0;
while ct<Nu
    for idx1 = 1:Ncpu
        ct = ct+1;
        if ct>Nu
            break
        end
        chunksize(idx1) = chunksize(idx1)+1;
        
    end
end 

startidx=1;
idx1 = 1;
while idx1 <= Ncpu
    endidx=startidx+chunksize(idx1)-1;
    tcSplit{idx1} = tc(startidx:endidx,:);
    startidx=endidx+1;
    idx1 = idx1+1;
end